<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>现场规范化标准系统，请登录</title>
    <!-- Bootstrap -->
    <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
    <!-- Bootstrap -->
    <!-- 自定义 css -->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/reset.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/login.css">
    <!-- jquery -->
    <script src="__PUBLIC__/script/jquery.1.11.1.js"></script>
    <!-- 自定义 css -->
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="__PUBLIC__/script/html5shiv.min.js"></script>
      <script src="__PUBLIC__/script/respond.js"></script>
    <![endif]-->
</head>

<body>
    <!--登录内容 start-->
    <div class="container-fluid logbox">
        <div class="container login">
            <img src="__PUBLIC__/images/logo.png" class="loginlogo" />
            <form class="form-inline">
                <div class="form-group">
                    <label for="exampleInputName2" class="titlei">账号：</label>
                    <input type="text" class="form-control" name="usr" placeholder="请输入账号">
                </div>&nbsp;
                <div class="form-group">
                    <label for="exampleInputEmail2" class="titlei">密码：</label>
                    <input type="password" class="form-control" name="pwd" placeholder="请输入密码">
                </div>&nbsp;
                <submit class="btn btn-warning" id="logbtn">登录</submit>
            </form>
            <div class="row lfoot">
                <div class="col-md-6">汇氏环境 版权所有  2018-2020</div>
                <div class="col-md-6">技术支持：山东东博信息科技有限公司  www.doposoft.cn</div>
            </div>
        </div>
    </div>
    <script>
         $("#logbtn").click(function() {
            if($("input[name='usr']").val()=="" || $("input[name='pwd']").val()==""){
                alert('用户名和密码不能为空！');
                return false;
            }
            var option={
                type: "POST",
                url: "{:U('loginindex')}",
                data: {usr: $("input[name='usr']").val(),pwd: $("input[name='pwd']").val()},
                success: function(data) {
                    if(data['status']==1){
                        window.location.href="{:U('index')}";
                    }
                    else{
                        alert(data['info']);
                    }
                }
            };
            $.ajax(option);
        })

        //enter提交登录
        $(document).keydown(function(event){
            if(event.keyCode ==13){
                $("#logbtn").click();
            }
        });
    </script>
</body>

</html>